<?php
class Kd_Data_Dcl_Expression_Field extends Kd_Data_Dcl_Expression_Base{
	
	private $_name = '';
    private $_tableName = '';
	
	public function __construct($expString = ''){
		parent::__construct();
        $this->setName($expString);
	}

    public function getTableName(){
        return $this->_tableName;
    }
    public function setTableName($value){
        $this->_tableName = $value;
        return $this;
    }
	
	public function getName(){
		return $this->_name;
	}
	public function setName($value){
        if(is_string($value) && !empty($value)){
            if(($pos = strpos($value, '.')) !== FALSE){
                $this->_tableName = substr($value, 0, $pos);
                $this->_name = substr($value, $pos + 1);
            }else{
                $this->_name = $value;
            }
        }else{
            $this->_name = $value;
        }
		return $this;
	}
	
	public function getExpressionType(){
		return 'field';
	}
}